package com.prig.base.repository;

import com.prig.base.entity.AdminRoleRelation;
import com.prig.base.entity.AdminRoleRelationId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

@Repository
public interface AdminRoleRelationRepository extends JpaRepository<AdminRoleRelation, AdminRoleRelationId> {
    @Transactional
    @Query(nativeQuery = true,value = "delete from admin_role_relation where admin_id = :adminId")
    @Modifying
    void deleteByAdminId(long adminId);
}
